home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 48
/
Amiga Format CD48 (1999-12-13)(Future Publishing)(GB)(Track 1 of 2)[!][issue 2000-01].iso
/
-websites-
/
whdload
/
games
/
megalomania.lha
/
MegaLoMania Install
/
Install
next >
Wrap
Text File
|
1998-07-09
|
4KB
|
206 lines
;----------------------------
; BJ (07.01.97)
; bj 02.03.97 support for "ram disk:"
; tabsize=4
;----------------------------
;****************************
(set #readme-file "README") ;name of readme file
;(set #slave-name "") ;optional !
(set #cleanup "install.slave") ;files to delete after install
;****************************
(if
(<> #slave-name "")
(set #slave-name ("%s.slave" @app-name))
)
;****************************
;----------------------------
; Checks if given program is reachable via the path
; parameters:
; #program - to check
; result:
; #instok - 0 if not found
(procedure P_chkinst
(if
(= 0 (run ("cd SYS:\nWhich %s" #program)))
(set #instok 1)
(set #instok 0)
)
)
;----------------------------
; Checks if given program is reachable via the path
; if not reachable tries to install from local to RAM:
; if fails abort install
; parameters:
; #program - to check
(procedure P_chkrun
(P_chkinst)
(if
(= #instok 0)
(
(if
(exists #program)
(copyfiles
(help @copyfiles-help)
(source #program)
(dest "RAM:") ;should always be in the path
)
(if
(exists ("//c/%s" #program)) ;on installation package
(copyfiles
(help @copyfiles-help)
(source ("//c/%s" #program))
(dest "RAM:") ;should always be in the path
)
(abort ("You must install %s first !" #program))
)
)
(set #cleanup ("RAM:%s %s" #program #cleanup))
)
)
)
;----------------------------
(procedure P_install
(
(set #sver (getversion #source-file))
(if
(exists #dest-file)
(
(set #dver (getversion #dest-file))
(if (>= #sver #dver)
(
(if
(= @user-level 2)
(message ("\nnow installing\n\n\"%s\" %ld.%ld\n\nover\n\n\"%s\" %ld.%ld" #source-file (/ #sver 65536) (BITAND #sver 65535) #dest-file (/ #dver 65536) (BITAND #dver 65535)))
)
(copyfiles
(help @copyfiles-help)
(source #source-file)
(dest (pathonly #dest-file))
(newname (fileonly #dest-file))
)
)
)
)
(
(if
(= @user-level 2)
(message ("\nnow installing\n\n\"%s\" %ld.%ld\n\nto\n\n\"%s\"" #source-file (/ #sver 65536) (BITAND #sver 65535) #dest-file ))
)
(copyfiles
(help @copyfiles-help)
(source #source-file)
(dest (pathonly #dest-file))
(newname (fileonly #dest-file))
)
)
)
)
)
;****************************
(if
(exists #readme-file)
(if
(= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
("")
(run ("SYS:Utilities/More %s" #readme-file))
)
)
;install whdload if available
(set #file "WHDLoad")
(if
(exists #file)
(
(set #source-file #file)
(set #dest-file (tackon "C:" #file))
(P_install)
)
)
;check if WHDLoad is installed
(set #program "WHDLoad")
(P_chkinst)
(if
(= #instok 0)
(abort "You must install WHDLoad first !")
)
(set @default-dest
(askdir
(prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
(help @askdir-help)
(default @default-dest)
(disk)
)
)
(set #dest (tackon @default-dest @app-name))
;if anything similar exist delete it
(if
(exists #dest)
(run ("Delete \"%s\" \"%s.info\" all" #dest #dest))
)
(makedir #dest
(help @makedir-help)
(infos)
)
;----------------------------
(makedir
(tackon #dest "data")
(help @makedir-help)
)
(copyfiles
(help @copyfiles-help)
(source #slave-name)
(dest #dest)
)
(copyfiles
(help @copyfiles-help)
(source "install.slave")
(dest #dest)
)
(copyfiles
(help @copyfiles-help)
(source ("%s.inf" @app-name ))
(newname ("%s.info" @app-name ))
(dest #dest)
)
(if
(exists #readme-file)
(copyfiles
(help @copyfiles-help)
(source #readme-file)
(dest #dest)
)
)
(run ("cd \"%s\"\nwhdload install.slave WriteDelay=0" #dest))
(if
(exists (tackon #dest "data/laser2b"))
("")
(abort "make sure it is enough free space on the installation drive")
)
;----------------------------
(run ("cd \"%s\"\nDelete %s ALL QUIET FORCE" #dest #cleanup)) ;delete all temporary files
(exit)